﻿using System;
using System.Data;
using System.Collections.Generic;
using EnterpriseFund.Model;
namespace EnterpriseFund.BLL
{
    /// <summary>
    /// TaxAuditForm
    /// </summary>
    public partial class TaxAuditForm
    {
        private readonly EnterpriseFund.DAL.TaxAuditForm dal = new EnterpriseFund.DAL.TaxAuditForm();
        public TaxAuditForm()
        { }
        #region  BasicMethod
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.TaxAuditForm GetModel(string FTaxAuditId)
        {
            return dal.GetModel(FTaxAuditId);
        }

        public void Return(Model.TaxAuditForm tAF)
        {
            dal.Return(tAF);
        }

        public void UpdateStatus(Model.TaxAuditForm tAF, string status)
        {
            dal.UpdateStatus(tAF, status); 
        }

        public void Delete(string FTaxAuditId)
        {
            dal.Delete(FTaxAuditId);
        }
            /// <summary>
        /// 获取审核数据
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="fOrderFiled"></param>
        /// <returns></returns>
        public DataSet GetDataforAuditForSave(string beginDate, string endDate, string Year, string NSRDZDAH)
        {
            return dal.GetDataforAuditForSave(beginDate, endDate, Year, NSRDZDAH);
        }

        public bool ExistsByYGZ(string NSRDZDAH, string FYear)
        {
            return dal.ExistsByYGZ(NSRDZDAH, FYear);
        }

        public void Update(Model.TaxAuditForm model, List<Model.TaxAuditAdjust> taxAuditAdjustList, List<Model.TaxAudit_SB_ZSXX> taxAudit_SB_ZSXXList)
        {
            dal.Update(model, taxAuditAdjustList, taxAudit_SB_ZSXXList);
        }

        public bool ExistsAuditByNsbm2(string NSRDZDAH)
        {
            return dal.ExistsAuditByNsbm2(NSRDZDAH);
        }
        public bool ExistsAuditByNsbm(string NSRDZDAH, string beginDate, string endDate)
        {
            return dal.ExistsAuditByNsbm(NSRDZDAH, beginDate, endDate);
        }

        public string Add(Model.TaxAuditForm model, List<Model.TaxAuditAdjust> taxAuditAdjustList, List<Model.TaxAudit_SB_ZSXX> taxAudit_SB_ZSXXList)
        {
            return dal.Add(model, taxAuditAdjustList, taxAudit_SB_ZSXXList);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.TaxAuditForm> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.TaxAuditForm> DataTableToList(DataTable dt)
        {
            List<EnterpriseFund.Model.TaxAuditForm> modelList = new List<EnterpriseFund.Model.TaxAuditForm>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                EnterpriseFund.Model.TaxAuditForm model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere,string year)
        {
            return dal.GetRecordCount(strWhere,year);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

